<!DOCTYPE html>
<html lang="en" class="svg no-js">
<head>
    <meta charset="utf-8" />
    <!--[if IE ]>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="Language" content="en">

    <title>MySQL :: MySQL 8.0 Reference Manual :: 12.5.2 Regular Expressions</title>
    <link rel="stylesheet" media="all" href="css/main-20190125.min.css" />
            <link rel="stylesheet" media="all" href="css/docs-20190125.min.css" />
    
    
    <link rel="stylesheet" media="print" href="css/print-20190125.min.css" />

    
    
    
    
            <link rel="contents" href="index.html" title="MySQL 8.0 Reference Manual" />
<link rel="start" href="index.html" title="MySQL 8.0 Reference Manual" />
<link rel="prev" href="string-comparison-functions.html" title="12.5.1 String Comparison Functions" />
<link rel="next" href="string-functions-charset.html?ff=nopfpls" title="12.5.3 Character Set and Collation of Function Results" />
<link rel="up" href="string-functions.html" title="12.5 String Functions" />

    
    <link rel="shortcut icon" href="favicon.ico" />
    <script>(function(H){ H.className=H.className.replace(/\bno-js\b/,'js') })(document.documentElement)</script>
    <script src="js/site-20181120.min.js"></script>

    
    
    
    <!--[if lt IE 9]>
        <script src="https://labs.mysql.com/common/js/polyfills/html5shiv-printshiv-3.7.2.min.js"></script>
        <script src="https://labs.mysql.com/common/js/polyfills/respond-1.4.2.min.js"></script>
    <![endif]-->
        <!--[if IE 9]>
        <style>#docs-sidebar-toc { box-sizing: content-box; }</style>
    <![endif]-->
    </head>

<body class="no-sidebar full-page dev">
<div class="page-wrapper">
    <header>

                        <a href="https://dev.mysql.com/" aria-label="Home" title="MySQL" id="l1-home-link"></a>
        
        <div id="l1-nav-container">
            <div id="l1-line1">
                <div id="l1-auth-links">
                    <a href="https://www.mysql.com/about/contact/"><b>Contact MySQL</b></a>
                    <span id="l1-contact-separator">&nbsp;|&nbsp;</span>
                    <span id="l1-contact-separator-br"><br /></span>
                                             <a href="https://dev.mysql.com/auth/login/?dest=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Fregexp.html">Login</a> &nbsp;|&nbsp;
                         <a href="https://dev.mysql.com/auth/register/">Register</a>
                                    </div>
                <div id="l1-lhs">
                    <div id="l1-slogan">
                        The world's most popular open source database
                    </div>
                    <div id="l1-search-box">
                        <form id="l1-search-form" method="get" action="https://www.oracle.com/search/results">
                        <input type="hidden" name="cat" value="mysql" />
                        <input type="hidden" name="Ntk" value="SI-ALL5" />
                        <input id="l1-search-input" type="search" class="icon-search" placeholder="Search" aria-label="Search" name="Ntt" />
                        </form>
                    </div>
                </div>
            </div>
            <div id="l1-line2">
                <div class="social-icons">
                    <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook"></span></a>
                    <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter"></span></a>
                    <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin"></span></a>
                    <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube"></span></a>
                </div>
                <ul id="l1-nav">
                    <li>
                        <a href="https://www.mysql.com/"><!-- <span class="icon-sakila"></span>  -->MySQL.com</a>
                    </li><li>
                        <a href="https://www.mysql.com/downloads/"><!-- <span class="icon-download-thin"></span>  -->Downloads</a>
                    </li><li class="active">
                        <a href="/doc/"><!-- <span class="icon-books"></span>  -->Documentation</a>
                    </li><li>
                        <a href="/"><!-- <span class="icon-code"></span>  -->Developer Zone</a>
                    </li>                </ul>
            </div>
        </div>
        <div id="sub-header">
            <div id="l2-nav-container">
                <div id="l2-nav-toggle">
                    <span class="icon-three-bars"></span>
                </div>
                                                                                        <a class="button nav-button-3" href="/"><span class="icon-code"></span> Developer Zone</a>
                                                                                                                                    <a class="button nav-button-2" href="https://www.mysql.com/downloads/"><span class="icon-download-thin"></span> Downloads</a>
                                                                                                <a class="button nav-button-1" href="https://www.mysql.com/"><span class="icon-sakila"></span> MySQL.com</a>
                                                                        <div id="l2-search-toggle">
                    <span class="icon-search"></span>
                </div>
                <div id="l2-site-icon">
                                                                                                                                                                                                    <span class="icon-books"></span>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div>
                <div id="l1-section-title">
                    <span id="l1-section-label">
                        <a href="/doc/">Documentation</a>
                    </span>
                </div>
                <nav>
                    

<ul id="l2-nav">
            	<li class="active"><a class="active " href="/doc/refman/en/">MySQL Server</a>
    			</li>
	        	<li class=""><a  href="/doc/index-enterprise.html">MySQL Enterprise</a>
    			</li>
	        	<li class=""><a  href="/doc/workbench/en/">Workbench</a>
    			</li>
	        	<li class=""><a  href="/doc/en/mysql-innodb-cluster-userguide.html">InnoDB Cluster</a>
    			</li>
	        	<li class=""><a  href="/doc/index-cluster.html">MySQL NDB Cluster</a>
    			</li>
	        	<li class=""><a  href="/doc/index-connectors.html">Connectors</a>
    			</li>
	        	<li class=" last"><a  href="/doc/index-other.html">More</a>
    			</li>
	                        <li class="other-section"><a href="https://www.mysql.com/">MySQL.com</a></li>
                            <li class="other-section"><a href="https://www.mysql.com/downloads/">Downloads</a></li>
                                        <li class="other-section"><a href="/">Developer Zone</a></li>
            </ul>
                </nav>
            </div>
            <div id="l3-search-container"></div>
            <div id="top-orange"><span id="section-nav">Section Menu: &nbsp; </span></div>
        </div>
    </header>
        <div id="page">
                        <div role="main" id="main">

            
                
            
<div>
    <div id="docs-sidebar-toc" class="">
    <div id="docs-toc-inner">
        <div class="docs-sidebar-header" id="docs-nav-header">
            <a class="docs-show-hide-nav" id="docs-hide-nav" href="" title="Hide Sidebar" aria-label="Hide Sidebar"><span class="icon-arrow-small-left"></span></a>
            <div class="docs-nav-links">
                                    
    <a href="string-comparison-functions.html"
        aria-label="Previous" title="Previous: String Comparison Functions"><span
        class="icon-chevron-left"></span></a>
<a href="index.html" aria-label="Start" title="Start"><span class="icon-book-open"></span></a>
        <a aria-label="Up" href="string-functions.html" title="Up: String Functions"><span class="icon-chevron-up"></span></a>
    <a href="string-functions-charset.html" aria-label="Next"
        title="Next: Character Set and Collation of Function Results"><span
        class="icon-chevron-right"></span></a>
                            </div>
        </div>
                    
<div id="docs-sidebar-search-container">
    <div id="docs-sidebar-search-box">
        <form method="get" action="/mysql-manual/search-page">
            <input type="hidden" name="d" id="d" value="201" />
            <input type="hidden" name="p" id="p" value="1" />
            <input type="text" name="keyword" id="q" title="Search this Manual"
                value=""
                style="color: #bbb;"
                onfocus=""
                onblur="" />

            <button class="docs-sidebar-search-btn" aria-label="Search" title="Search" type="submit">
                <span class="icon-search"></span>
            </button>
        </form>
    </div>
</div>
                <div class="docs-sidebar-nav">
            <a class="docs-icon-home" href="/doc/"><span class="icon-home"></span>Documentation Home</a><hr />
            <div class="docs-sidebar-mtitle">MySQL 8.0 Reference Manual</div>
            <nav class="doctoc" id="doc-201">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="preface.html">Preface and Legal Notices</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="introduction.html">General Information</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="installing.html">Installing and Upgrading MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="tutorial.html">Tutorial</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="programs.html">MySQL Programs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="server-administration.html">MySQL Server Administration</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="security.html">Security</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="backup-and-recovery.html">Backup and Recovery</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="optimization.html">Optimization</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="language-structure.html">Language Structure</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="charset.html">Character Sets, Collations, Unicode</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="data-types.html">Data Types</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="functions.html">Functions and Operators</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="func-op-summary-ref.html">Function and Operator Reference</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="type-conversion.html">Type Conversion in Expression Evaluation</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="non-typed-operators.html">Operators</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="operator-precedence.html">Operator Precedence</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="comparison-operators.html">Comparison Functions and Operators</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="logical-operators.html">Logical Operators</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="assignment-operators.html">Assignment Operators</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="control-flow-functions.html">Control Flow Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="string-functions.html">String Functions</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="string-comparison-functions.html">String Comparison Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link current"><a href="regexp.html">Regular Expressions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="string-functions-charset.html">Character Set and Collation of Function Results</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="numeric-functions.html">Numeric Functions and Operators</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="arithmetic-functions.html">Arithmetic Operators</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="mathematical-functions.html">Mathematical Functions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="date-and-time-functions.html">Date and Time Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="mysql-calendar.html">What Calendar Is Used By MySQL?</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="fulltext-search.html">Full-Text Search Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-natural-language.html">Natural Language Full-Text Searches</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-boolean.html">Boolean Full-Text Searches</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-query-expansion.html">Full-Text Searches with Query Expansion</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-stopwords.html">Full-Text Stopwords</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-restrictions.html">Full-Text Restrictions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-fine-tuning.html">Fine-Tuning MySQL Full-Text Search</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="full-text-adding-collation.html">Adding a Collation for Full-Text Indexing</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-search-ngram.html">ngram Full-Text Parser</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fulltext-search-mecab.html">MeCab Full-Text Parser Plugin</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="cast-functions.html">Cast Functions and Operators</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="xml-functions.html">XML Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="bit-functions.html">Bit Functions and Operators</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="encryption-functions.html">Encryption and Compression Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="locking-functions.html">Locking Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="information-functions.html">Information Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="spatial-analysis-functions.html">Spatial Analysis Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-function-reference.html">Spatial Function Reference</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-function-argument-handling.html">Argument Handling by Spatial Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-wkt-functions.html">Functions That Create Geometry Values from WKT Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-wkb-functions.html">Functions That Create Geometry Values from WKB Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-mysql-specific-functions.html">MySQL-Specific Functions That Create Geometry Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-format-conversion-functions.html">Geometry Format Conversion Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="gis-property-functions.html">Geometry Property Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-general-property-functions.html">General Geometry Property Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-point-property-functions.html">Point Property Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-linestring-property-functions.html">LineString and MultiLineString Property Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-polygon-property-functions.html">Polygon and MultiPolygon Property Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gis-geometrycollection-property-functions.html">GeometryCollection Property Functions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-operator-functions.html">Spatial Operator Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="spatial-relation-functions.html">Functions That Test Spatial Relations Between Geometry Objects</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-relation-functions-object-shapes.html">Spatial Relation Functions That Use Object Shapes</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-relation-functions-mbr.html">Spatial Relation Functions That Use Minimum Bounding Rectangles</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-geohash-functions.html">Spatial Geohash Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-geojson-functions.html">Spatial GeoJSON Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="spatial-convenience-functions.html">Spatial Convenience Functions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="json-functions.html">JSON Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-function-reference.html">JSON Function Reference</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-creation-functions.html">Functions That Create JSON Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-search-functions.html">Functions That Search JSON Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-modification-functions.html">Functions That Modify JSON Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-attribute-functions.html">Functions That Return JSON Value Attributes</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-table-functions.html">JSON Table Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-validation-functions.html">JSON Schema Validation Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="json-utility-functions.html">JSON Utility Functions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="gtid-functions.html">Functions Used with Global Transaction Identifiers (GTIDs)</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="enterprise-encryption.html">MySQL Enterprise Encryption Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="enterprise-encryption-installation.html">MySQL Enterprise Encryption Installation</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="enterprise-encryption-usage.html">MySQL Enterprise Encryption Usage and Examples</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="enterprise-encryption-function-reference.html">MySQL Enterprise Encryption Function Reference</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="enterprise-encryption-functions.html">MySQL Enterprise Encryption Function Descriptions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="group-by-functions-and-modifiers.html">Aggregate (GROUP BY) Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="group-by-functions.html">Aggregate (GROUP BY) Function Descriptions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="group-by-modifiers.html">GROUP BY Modifiers</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="group-by-handling.html">MySQL Handling of GROUP BY</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="group-by-functional-dependence.html">Detection of Functional Dependence</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="window-functions.html">Window Functions</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="window-function-descriptions.html">Window Function Descriptions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="window-functions-usage.html">Window Function Concepts and Syntax</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="window-functions-frames.html">Window Function Frame Specification</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="window-functions-named-windows.html">Named Windows</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="window-function-restrictions.html">Window Function Restrictions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="performance-schema-functions.html">Performance Schema Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="internal-functions.html">Internal Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="miscellaneous-functions.html">Miscellaneous Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="precision-math.html">Precision Math</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="precision-math-numbers.html">Types of Numeric Values</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="precision-math-decimal-characteristics.html">DECIMAL Data Type Characteristics</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="precision-math-expressions.html">Expression Handling</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="precision-math-rounding.html">Rounding Behavior</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="precision-math-examples.html">Precision Math Examples</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="sql-syntax.html">SQL Statement Syntax</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="data-dictionary.html">MySQL Data Dictionary</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="innodb-storage-engine.html">The InnoDB Storage Engine</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="storage-engines.html">Alternative Storage Engines</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="replication.html">Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="group-replication.html">Group Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="mysql-shell-userguide.html">MySQL Shell</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="document-store.html">Using MySQL as a Document Store</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-innodb-cluster-userguide.html">InnoDB Cluster</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-cluster.html">MySQL NDB Cluster 8.0</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="partitioning.html">Partitioning</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="stored-objects.html">Stored Objects</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="information-schema.html">INFORMATION_SCHEMA Tables</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="performance-schema.html">MySQL Performance Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="sys-schema.html">MySQL sys Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="connectors-apis.html">Connectors and APIs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="extending-mysql.html">Extending MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-enterprise.html">MySQL Enterprise Edition</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="workbench.html">MySQL Workbench</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="faqs.html">MySQL 8.0 Frequently Asked Questions</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="error-handling.html">Errors, Error Codes, and Common Problems</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="restrictions.html">Restrictions and Limits</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="indexes.html">Indexes</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="glossary.html">MySQL Glossary</a></div></div>                    </li>
        </ul>
                            </nav>
        </div>

        
<a class="docs-sidebar-section" href=""><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian open">
    <div class="text">
        <a href="/doc/relnotes/mysql/8.0/en/">MySQL 8.0 Release Notes</a><br />
        <a href="/doc/dev/mysql-server/latest/">MySQL 8.0 Source Code Documentation</a><br />
        </div>
</div>

    <a class="docs-sidebar-section" href=""><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian open">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.pdf">PDF (US Ltr)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.a4.pdf">PDF (A4)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-pdf-1-20190611.noarch.rpm">PDF (RPM)</a>
            - 41.5Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-html-chapter-1-20190611.noarch.rpm">HTML Download (RPM)</a>
            - 9.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 220.4Kb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.zip">Man Pages (Zip)</a>
            - 325.8Kb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.gz">Info (Gzip)</a>
            - 4.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.zip">Info (Zip)</a>
            - 4.1Mb<br />
                    </div>
    </div>

<a class="docs-sidebar-section" href=""><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="/doc/mysql-backup-excerpt/8.0/en/">MySQL Backup and Recovery</a><br />
                <a href="/doc/mysql-g11n-excerpt/8.0/en/">MySQL Globalization</a><br />
                <a href="/doc/mysql-infoschema-excerpt/8.0/en/">MySQL Information Schema</a><br />
                <a href="/doc/mysql-installation-excerpt/8.0/en/">MySQL Installation Guide</a><br />
                <a href="/doc/mysql-security-excerpt/8.0/en/">Security in MySQL</a><br />
                <a href="/doc/mysql-startstop-excerpt/8.0/en/">Starting and Stopping MySQL</a><br />
                <a href="/doc/mysql-linuxunix-excerpt/8.0/en/">MySQL and Linux/Unix</a><br />
                <a href="/doc/mysql-windows-excerpt/8.0/en/">MySQL and Windows</a><br />
                <a href="/doc/mysql-osx-excerpt/8.0/en/">MySQL and OS X</a><br />
                <a href="/doc/mysql-solaris-excerpt/8.0/en/">MySQL and Solaris</a><br />
                <a href="/doc/mysql-sourcebuild-excerpt/8.0/en/">Building MySQL from Source</a><br />
                <a href="/doc/mysql-reslimits-excerpt/8.0/en/">MySQL Restrictions and Limitations</a><br />
                <a href="/doc/mysql-partitioning-excerpt/8.0/en/">MySQL Partitioning</a><br />
                <a href="/doc/mysql-secure-deployment-guide/8.0/en/">MySQL Secure Deployment Guide</a><br />
                <a href="/doc/mysql-tutorial-excerpt/8.0/en/">MySQL Tutorial</a><br />
                <a href="/doc/mysql-perfschema-excerpt/8.0/en/">MySQL Performance Schema</a><br />
                <a href="/doc/mysql-replication-excerpt/8.0/en/">MySQL Replication</a><br />
                <a href="/doc/mysql-repo-excerpt/8.0/en/">Using the MySQL Yum Repository</a><br />
            </div>
</div>

        <br /><span id="wkr"><br /></span>
    </div>
    </div>

    <div id="docs-main" class="has-toc">
    <div id="docs-main-inner">

                <div class="right" id="docs-version-nav">
            <a href="" id="docs-version-nav-toggle">version 8.0
            <span class="icon-chevron-down"></span></a>
            <div id="docs-version-list">
                                                                                            <a                         href="/doc/refman/5.7/en/regexp.html">
                        5.7
                                            </a><br />
                                                                            <a                         href="/doc/refman/5.6/en/regexp.html">
                        5.6
                                            </a><br />
                                                                            <a                         href="/doc/refman/5.5/en/regexp.html">
                        5.5
                                            </a><br />
                                                                        <div id="docs-version-nav-lang">
                                                                                                                                                    <a                                     href="/doc/refman/5.6/ja/regexp.html">
                                    5.6&nbsp;
                                                                            Japanese
                                                                    </a><br />
                                                                                            </div>
                            </div>
        </div>
        
        <div id="docs-show-nav" class="left hidden" style="margin-right: 15px;">
            <a class="docs-show-hide-nav" href="" aria-label="Show Sidebar"
                title="Show Sidebar"><span class="icon-arrow-small-right"></span></a>
        </div>

                        <div id="docs-breadcrumbs">
            <a href="/doc/refman/8.0/en/">MySQL 8.0 Reference Manual</a> &nbsp;/&nbsp;
                            <span id="breadcrumbs-link"><a href="" id="show-breadcrumbs">...</a> &nbsp;/&nbsp;</span>
                <span class="hidden" id="hidden-breadcrumbs">
                                                        <a href="functions.html">Functions and Operators</a> &nbsp;/&nbsp;
                                                            <a href="string-functions.html">String Functions</a> &nbsp;/&nbsp;
                                                                                        </span>
                                        Regular Expressions
                                    </div>
        
        <div id="docs-body">
        
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="regexp"></a>12.5.2 Regular Expressions</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139663193221968"></a><a class="indexterm" name="idm139663193220896"></a><a class="indexterm" name="idm139663193219808"></a>
<div class="table">
<a name="idm139663193218320"></a><p class="title"><b>Table 12.9 Regular Expression Functions and
Operators</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="A reference that lists regular expression functions and operators."><col width="40%"><col width="60%"><thead><tr><th scope="col">Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="regexp.html#operator_not-regexp"><code class="literal">NOT REGEXP</code></a></td>
<td>
      Negation of REGEXP
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#operator_regexp"><code class="literal">REGEXP</code></a></td>
<td>
      Whether string matches regular expression
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#function_regexp-instr"><code class="literal">REGEXP_INSTR()</code></a></td>
<td>
      Starting index of substring matching regular expression
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a></td>
<td>
      Whether string matches regular expression
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#function_regexp-replace"><code class="literal">REGEXP_REPLACE()</code></a></td>
<td>
      Replace substrings matching regular expression
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#function_regexp-substr"><code class="literal">REGEXP_SUBSTR()</code></a></td>
<td>
      Return substring matching regular expression
    </td>
</tr><tr><td scope="row"><a class="link" href="regexp.html#operator_regexp"><code class="literal">RLIKE</code></a></td>
<td>
      Whether string matches regular expression
    </td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
        A regular expression is a powerful way of specifying a pattern
        for a complex search. This section discusses the functions and
        operators available for regular expression matching and
        illustrates, with examples, some of the special characters and
        constructs that can be used for regular expression operations.
        See also <a class="xref" href="pattern-matching.html" title="3.3.4.7 Pattern Matching">Section 3.3.4.7, “Pattern Matching”</a>.
      </p><p>
        MySQL implements regular expression support using International
        Components for Unicode (ICU), which provides full Unicode
        support and is multibyte safe. (Prior to MySQL 8.0.4, MySQL used
        Henry Spencer's implementation of regular expressions, which
        operates in byte-wise fashion and is not multibyte safe. For
        information about ways in which applications that use regular
        expressions may be affected by the implementation change, see
        <a class="xref" href="regexp.html#regexp-compatibility" title="Regular Expression Compatibility Considerations">Regular Expression Compatibility Considerations</a>.)
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="regexp.html#regexp-operators" title="Regular Expression Functions and Operators">Regular Expression Functions and Operators</a></p></li><li class="listitem"><p><a class="xref" href="regexp.html#regexp-syntax" title="Regular Expression Syntax">Regular Expression Syntax</a></p></li><li class="listitem"><p><a class="xref" href="regexp.html#regexp-resource-control" title="Regular Expression Resource Control">Regular Expression Resource Control</a></p></li><li class="listitem"><p><a class="xref" href="regexp.html#regexp-compatibility" title="Regular Expression Compatibility Considerations">Regular Expression Compatibility Considerations</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="regexp-operators"></a>Regular Expression Functions and Operators</h4>

</div>

</div>

</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a name="operator_not-regexp"></a><p>
              <a class="indexterm" name="idm139663193178096"></a>

              <a class="link" href="regexp.html#operator_not-regexp"><code class="literal"><em class="replaceable"><code>expr</code></em>
              NOT REGEXP <em class="replaceable"><code>pat</code></em></code></a>,
              <a class="link" href="regexp.html#operator_not-regexp"><code class="literal"><em class="replaceable"><code>expr</code></em>
              NOT RLIKE <em class="replaceable"><code>pat</code></em></code></a>
            </p><p>
              This is the same as <code class="literal">NOT
              (<em class="replaceable"><code>expr</code></em> REGEXP
              <em class="replaceable"><code>pat</code></em>)</code>.
            </p></li><li class="listitem"><a name="operator_regexp"></a><p>
              <a class="indexterm" name="idm139663193166672"></a>

              <a class="indexterm" name="idm139663193165600"></a>

              <a class="link" href="regexp.html#operator_regexp"><code class="literal"><em class="replaceable"><code>expr</code></em>
              REGEXP <em class="replaceable"><code>pat</code></em></code></a>,
              <a class="link" href="regexp.html#operator_regexp"><code class="literal"><em class="replaceable"><code>expr</code></em>
              RLIKE <em class="replaceable"><code>pat</code></em></code></a>
            </p><p>
              Returns 1 if the string <em class="replaceable"><code>expr</code></em>
              matches the regular expression specified by the pattern
              <em class="replaceable"><code>pat</code></em>, 0 otherwise. If
              <em class="replaceable"><code>expr</code></em> or
              <em class="replaceable"><code>pat</code></em> is <code class="literal">NULL</code>,
              the return value is <code class="literal">NULL</code>.
            </p><p>
              <a class="link" href="regexp.html#operator_regexp"><code class="literal">REGEXP</code></a> and
              <a class="link" href="regexp.html#operator_regexp"><code class="literal">RLIKE</code></a> are
              synonyms for <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
            </p><p>
              For additional information about how matching occurs, see
              the description for
              <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT 'Michael!' REGEXP '.*';
+------------------------+
| 'Michael!' REGEXP '.*' |
+------------------------+
|                      1 |
+------------------------+
mysql&gt; SELECT 'new*\n*line' REGEXP 'new\\*.\\*line';
+---------------------------------------+
| 'new*\n*line' REGEXP 'new\\*.\\*line' |
+---------------------------------------+
|                                     0 |
+---------------------------------------+
mysql&gt; SELECT 'a' REGEXP '^[a-d]';
+---------------------+
| 'a' REGEXP '^[a-d]' |
+---------------------+
|                   1 |
+---------------------+
mysql&gt; SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';
+----------------+-----------------------+
| 'a' REGEXP 'A' | 'a' REGEXP BINARY 'A' |
+----------------+-----------------------+
|              1 |                     0 |
+----------------+-----------------------+</code></pre></li><li class="listitem"><a name="function_regexp-instr"></a><p>
              <a class="link" href="regexp.html#function_regexp-instr"><code class="literal">REGEXP_INSTR(<em class="replaceable"><code>expr</code></em>,
              <em class="replaceable"><code>pat</code></em>[,
              <em class="replaceable"><code>pos</code></em>[,
              <em class="replaceable"><code>occurrence</code></em>[,
              <em class="replaceable"><code>return_option</code></em>[,
              <em class="replaceable"><code>match_type</code></em>]]]])</code></a>
            </p><a class="indexterm" name="idm139663193137168"></a><p>
              Returns the starting index of the substring of the string
              <em class="replaceable"><code>expr</code></em> that matches the regular
              expression specified by the pattern
              <em class="replaceable"><code>pat</code></em>, 0 if there is no match. If
              <em class="replaceable"><code>expr</code></em> or
              <em class="replaceable"><code>pat</code></em> is <code class="literal">NULL</code>,
              the return value is <code class="literal">NULL</code>. Character
              indexes begin at 1.
            </p><p>
              <a class="link" href="regexp.html#function_regexp-instr"><code class="literal">REGEXP_INSTR()</code></a> takes these
              optional arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <em class="replaceable"><code>pos</code></em>: The position in
                  <em class="replaceable"><code>expr</code></em> at which to start the
                  search. If omitted, the default is 1.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>occurrence</code></em>: Which
                  occurrence of a match to search for. If omitted, the
                  default is 1.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>return_option</code></em>: Which type
                  of position to return. If this value is 0,
                  <a class="link" href="regexp.html#function_regexp-instr"><code class="literal">REGEXP_INSTR()</code></a> returns
                  the position of the matched substring's first
                  character. If this value is 1,
                  <a class="link" href="regexp.html#function_regexp-instr"><code class="literal">REGEXP_INSTR()</code></a> returns
                  the position following the matched substring. If
                  omitted, the default is 0.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>match_type</code></em>: A string that
                  specifies how to perform matching. The meaning is as
                  described for
                  <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
</p></li></ul>
</div>
<p>
              For additional information about how matching occurs, see
              the description for
              <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_INSTR('dog cat dog', 'dog');
+------------------------------------+
| REGEXP_INSTR('dog cat dog', 'dog') |
+------------------------------------+
|                                  1 |
+------------------------------------+
mysql&gt; SELECT REGEXP_INSTR('dog cat dog', 'dog', 2);
+---------------------------------------+
| REGEXP_INSTR('dog cat dog', 'dog', 2) |
+---------------------------------------+
|                                     9 |
+---------------------------------------+
mysql&gt; SELECT REGEXP_INSTR('aa aaa aaaa', 'a{2}');
+-------------------------------------+
| REGEXP_INSTR('aa aaa aaaa', 'a{2}') |
+-------------------------------------+
|                                   1 |
+-------------------------------------+
mysql&gt; SELECT REGEXP_INSTR('aa aaa aaaa', 'a{4}');
+-------------------------------------+
| REGEXP_INSTR('aa aaa aaaa', 'a{4}') |
+-------------------------------------+
|                                   8 |
+-------------------------------------+</code></pre></li><li class="listitem"><a name="function_regexp-like"></a><p>
              <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE(<em class="replaceable"><code>expr</code></em>,
              <em class="replaceable"><code>pat</code></em>[,
              <em class="replaceable"><code>match_type</code></em>])</code></a>
            </p><a class="indexterm" name="idm139663193106192"></a><p>
              Returns 1 if the string <em class="replaceable"><code>expr</code></em>
              matches the regular expression specified by the pattern
              <em class="replaceable"><code>pat</code></em>, 0 otherwise. If
              <em class="replaceable"><code>expr</code></em> or
              <em class="replaceable"><code>pat</code></em> is <code class="literal">NULL</code>,
              the return value is <code class="literal">NULL</code>.
            </p><p>
              The pattern can be an extended regular expression, the
              syntax for which is discussed in
              <a class="xref" href="regexp.html#regexp-syntax" title="Regular Expression Syntax">Regular Expression Syntax</a>. The pattern need not be a
              literal string. For example, it can be specified as a
              string expression or table column.
            </p><p>
              The optional <em class="replaceable"><code>match_type</code></em>
              argument is a string that may contain any or all the
              following characters specifying how to perform matching:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <code class="literal">c</code>: Case sensitive matching.
                </p></li><li class="listitem"><p>
                  <code class="literal">i</code>: Case insensitive matching.
                </p></li><li class="listitem"><p>
                  <code class="literal">m</code>: Multiple-line mode. Recognize
                  line terminators within the string. The default
                  behavior is to match line terminators only at the
                  start and end of the string expression.
                </p></li><li class="listitem"><p>
                  <code class="literal">n</code>: The <code class="literal">.</code>
                  character matches line terminators. The default is for
                  <code class="literal">.</code> matching to stop at the end of a
                  line.
                </p></li><li class="listitem"><p>
                  <code class="literal">u</code>: Unix-only line endings. Only the
                  newline character is recognized as a line ending by
                  the <code class="literal">.</code>, <code class="literal">^</code>, and
                  <code class="literal">$</code> match operators.
</p></li></ul>
</div>
<p>
              If characters specifying contradictory options are
              specified within <em class="replaceable"><code>match_type</code></em>,
              the rightmost one takes precedence.
            </p><p>
              By default, regular expression operations use the
              character set and collation of the
              <em class="replaceable"><code>expr</code></em> and
              <em class="replaceable"><code>pat</code></em> arguments when deciding the
              type of a character and performing the comparison. If the
              arguments have different character sets or collations,
              coercibility rules apply as described in
              <a class="xref" href="charset-collation-coercibility.html" title="10.8.4 Collation Coercibility in Expressions">Section 10.8.4, “Collation Coercibility in Expressions”</a>.
              Arguments may be specified with explicit collation
              indicators to change comparison behavior.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('CamelCase', 'CAMELCASE');
+---------------------------------------+
| REGEXP_LIKE('CamelCase', 'CAMELCASE') |
+---------------------------------------+
|                                     1 |
+---------------------------------------+
mysql&gt; SELECT REGEXP_LIKE('CamelCase', 'CAMELCASE' COLLATE utf8mb4_0900_as_cs);
+------------------------------------------------------------------+
| REGEXP_LIKE('CamelCase', 'CAMELCASE' COLLATE utf8mb4_0900_as_cs) |
+------------------------------------------------------------------+
|                                                                0 |
+------------------------------------------------------------------+</code></pre><p>
              <em class="replaceable"><code>match_type</code></em> may be specified
              with the <code class="literal">c</code> or <code class="literal">i</code>
              characters to override the default case sensitivity.
              Exception: If either argument is a binary string, the
              arguments are handled in case-sensitive fashion as binary
              strings, even if <em class="replaceable"><code>match_type</code></em>
              contains the <code class="literal">i</code> character.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                Because MySQL uses the C escape syntax in strings (for
                example, <code class="literal">\n</code> to represent the newline
                character), you must double any <code class="literal">\</code>
                that you use in your <em class="replaceable"><code>expr</code></em> and
                <em class="replaceable"><code>pat</code></em> arguments.
</p>
</div>
<pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('Michael!', '.*');
+-------------------------------+
| REGEXP_LIKE('Michael!', '.*') |
+-------------------------------+
|                             1 |
+-------------------------------+
mysql&gt; SELECT REGEXP_LIKE('new*\n*line', 'new\\*.\\*line');
+----------------------------------------------+
| REGEXP_LIKE('new*\n*line', 'new\\*.\\*line') |
+----------------------------------------------+
|                                            0 |
+----------------------------------------------+
mysql&gt; SELECT REGEXP_LIKE('a', '^[a-d]');
+----------------------------+
| REGEXP_LIKE('a', '^[a-d]') |
+----------------------------+
|                          1 |
+----------------------------+
mysql&gt; SELECT REGEXP_LIKE('a', 'A'), REGEXP_LIKE('a', BINARY 'A');
+-----------------------+------------------------------+
| REGEXP_LIKE('a', 'A') | REGEXP_LIKE('a', BINARY 'A') |
+-----------------------+------------------------------+
|                     1 |                            0 |
+-----------------------+------------------------------+</code></pre><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('abc', 'ABC');
+---------------------------+
| REGEXP_LIKE('abc', 'ABC') |
+---------------------------+
|                         1 |
+---------------------------+
mysql&gt; SELECT REGEXP_LIKE('abc', 'ABC', 'c');
+--------------------------------+
| REGEXP_LIKE('abc', 'ABC', 'c') |
+--------------------------------+
|                              0 |
+--------------------------------+</code></pre></li><li class="listitem"><a name="function_regexp-replace"></a><p>
              <a class="link" href="regexp.html#function_regexp-replace"><code class="literal">REGEXP_REPLACE(<em class="replaceable"><code>expr</code></em>,
              <em class="replaceable"><code>pat</code></em>,
              <em class="replaceable"><code>repl</code></em>[,
              <em class="replaceable"><code>pos</code></em>[,
              <em class="replaceable"><code>occurrence</code></em>[,
              <em class="replaceable"><code>match_type</code></em>]]])</code></a>
            </p><a class="indexterm" name="idm139663193057040"></a><p>
              Replaces occurrences in the string
              <em class="replaceable"><code>expr</code></em> that match the regular
              expression specified by the pattern
              <em class="replaceable"><code>pat</code></em> with the replacement string
              <em class="replaceable"><code>repl</code></em>, and returns the resulting
              string. If <em class="replaceable"><code>expr</code></em>,
              <em class="replaceable"><code>pat</code></em>, or
              <em class="replaceable"><code>repl</code></em> is
              <code class="literal">NULL</code>, the return value is
              <code class="literal">NULL</code>.
            </p><p>
              <a class="link" href="regexp.html#function_regexp-replace"><code class="literal">REGEXP_REPLACE()</code></a> takes
              these optional arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <em class="replaceable"><code>pos</code></em>: The position in
                  <em class="replaceable"><code>expr</code></em> at which to start the
                  search. If omitted, the default is 1.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>occurrence</code></em>: Which
                  occurrence of a match to replace. If omitted, the
                  default is 0 (which means <span class="quote">“<span class="quote">replace all
                  occurrences</span>”</span>).
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>match_type</code></em>: A string that
                  specifies how to perform matching. The meaning is as
                  described for
                  <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
</p></li></ul>
</div>
<p>
              Prior to MySQL 8.0.17, the result returned by this
              function used the <code class="literal">UTF-16</code> character set;
              in MySQL 8.0.17 and later, the character set and collation
              of the expression searched for matches is used. (Bug
              #94203, Bug #29308212)
            </p><p>
              For additional information about how matching occurs, see
              the description for
              <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_REPLACE('a b c', 'b', 'X');
+-----------------------------------+
| REGEXP_REPLACE('a b c', 'b', 'X') |
+-----------------------------------+
| a X c                             |
+-----------------------------------+
mysql&gt; SELECT REGEXP_REPLACE('abc def ghi', '[a-z]+', 'X', 1, 3);
+----------------------------------------------------+
| REGEXP_REPLACE('abc def ghi', '[a-z]+', 'X', 1, 3) |
+----------------------------------------------------+
| abc def X                                          |
+----------------------------------------------------+</code></pre></li><li class="listitem"><a name="function_regexp-substr"></a><p>
              <a class="link" href="regexp.html#function_regexp-substr"><code class="literal">REGEXP_SUBSTR(<em class="replaceable"><code>expr</code></em>,
              <em class="replaceable"><code>pat</code></em>[,
              <em class="replaceable"><code>pos</code></em>[,
              <em class="replaceable"><code>occurrence</code></em>[,
              <em class="replaceable"><code>match_type</code></em>]]])</code></a>
            </p><a class="indexterm" name="idm139663193028656"></a><p>
              Returns the substring of the string
              <em class="replaceable"><code>expr</code></em> that matches the regular
              expression specified by the pattern
              <em class="replaceable"><code>pat</code></em>, <code class="literal">NULL</code> if
              there is no match. If <em class="replaceable"><code>expr</code></em> or
              <em class="replaceable"><code>pat</code></em> is <code class="literal">NULL</code>,
              the return value is <code class="literal">NULL</code>.
            </p><p>
              <a class="link" href="regexp.html#function_regexp-substr"><code class="literal">REGEXP_SUBSTR()</code></a> takes these
              optional arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <em class="replaceable"><code>pos</code></em>: The position in
                  <em class="replaceable"><code>expr</code></em> at which to start the
                  search. If omitted, the default is 1.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>occurrence</code></em>: Which
                  occurrence of a match to search for. If omitted, the
                  default is 1.
                </p></li><li class="listitem"><p>
                  <em class="replaceable"><code>match_type</code></em>: A string that
                  specifies how to perform matching. The meaning is as
                  described for
                  <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
</p></li></ul>
</div>
<p>
              Prior to MySQL 8.0.17, the result returned by this
              function used the <code class="literal">UTF-16</code> character set;
              in MySQL 8.0.17 and later, the character set and collation
              of the expression searched for matches is used. (Bug
              #94203, Bug #29308212)
            </p><p>
              For additional information about how matching occurs, see
              the description for
              <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_SUBSTR('abc def ghi', '[a-z]+');
+----------------------------------------+
| REGEXP_SUBSTR('abc def ghi', '[a-z]+') |
+----------------------------------------+
| abc                                    |
+----------------------------------------+
mysql&gt; SELECT REGEXP_SUBSTR('abc def ghi', '[a-z]+', 1, 3);
+----------------------------------------------+
| REGEXP_SUBSTR('abc def ghi', '[a-z]+', 1, 3) |
+----------------------------------------------+
| ghi                                          |
+----------------------------------------------+</code></pre></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="regexp-syntax"></a>Regular Expression Syntax</h4>

</div>

</div>

</div>
<p>
          A regular expression describes a set of strings. The simplest
          regular expression is one that has no special characters in
          it. For example, the regular expression
          <code class="literal">hello</code> matches <code class="literal">hello</code> and
          nothing else.
        </p><p>
          Nontrivial regular expressions use certain special constructs
          so that they can match more than one string. For example, the
          regular expression <code class="literal">hello|world</code> contains the
          <code class="literal">|</code> alternation operator and matches either
          the <code class="literal">hello</code> or <code class="literal">world</code>.
        </p><p>
          As a more complex example, the regular expression
          <code class="literal">B[an]*s</code> matches any of the strings
          <code class="literal">Bananas</code>, <code class="literal">Baaaaas</code>,
          <code class="literal">Bs</code>, and any other string starting with a
          <code class="literal">B</code>, ending with an <code class="literal">s</code>, and
          containing any number of <code class="literal">a</code> or
          <code class="literal">n</code> characters in between.
        </p><p>
          The following list covers some of the basic special characters
          and constructs that can be used in regular expressions. For
          information about the full regular expression syntax supported
          by the ICU library used to implement regular expression
          support, visit the
          <a class="ulink" href="http://userguide.icu-project.org/strings/regexp" target="_top">
          International Components for Unicode website</a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">^</code>
            </p><p>
              Match the beginning of a string.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('fo\nfo', '^fo$');                   -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('fofo', '^fo');                      -&gt; 1</code></pre></li><li class="listitem"><p>
              <code class="literal">$</code>
            </p><p>
              Match the end of a string.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('fo\no', '^fo\no$');                 -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('fo\no', '^fo$');                    -&gt; 0</code></pre></li><li class="listitem"><p>
              <code class="literal">.</code>
            </p><p>
              Match any character (including carriage return and
              newline, although to match these in the middle of a
              string, the <code class="literal">m</code> (multiple line)
              match-control character or the <code class="literal">(?m)</code>
              within-pattern modifier must be given).
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('fofo', '^f.*$');                    -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('fo\r\nfo', '^f.*$');                -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('fo\r\nfo', '^f.*$', 'm');           -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('fo\r\nfo', '(?m)^f.*$');           -&gt; 1</code></pre></li><li class="listitem"><p>
              <code class="literal">a*</code>
            </p><p>
              Match any sequence of zero or more <code class="literal">a</code>
              characters.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('Ban', '^Ba*n');                     -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('Baaan', '^Ba*n');                   -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('Bn', '^Ba*n');                      -&gt; 1</code></pre></li><li class="listitem"><p>
              <code class="literal">a+</code>
            </p><p>
              Match any sequence of one or more <code class="literal">a</code>
              characters.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('Ban', '^Ba+n');                     -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('Bn', '^Ba+n');                      -&gt; 0</code></pre></li><li class="listitem"><p>
              <code class="literal">a?</code>
            </p><p>
              Match either zero or one <code class="literal">a</code> character.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('Bn', '^Ba?n');                      -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('Ban', '^Ba?n');                     -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('Baan', '^Ba?n');                    -&gt; 0</code></pre></li><li class="listitem"><p>
              <code class="literal">de|abc</code>
            </p><p>
              Alternation; match either of the sequences
              <code class="literal">de</code> or <code class="literal">abc</code>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('pi', 'pi|apa');                     -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('axe', 'pi|apa');                    -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('apa', 'pi|apa');                    -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('apa', '^(pi|apa)$');                -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('pi', '^(pi|apa)$');                 -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('pix', '^(pi|apa)$');                -&gt; 0</code></pre></li><li class="listitem"><p>
              <code class="literal">(abc)*</code>
            </p><p>
              Match zero or more instances of the sequence
              <code class="literal">abc</code>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('pi', '^(pi)*$');                    -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('pip', '^(pi)*$');                   -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('pipi', '^(pi)*$');                  -&gt; 1</code></pre></li><li class="listitem"><p>
              <code class="literal">{1}</code>, <code class="literal">{2,3}</code>
            </p><p>
              Repetition;
              <code class="literal">{<em class="replaceable"><code>n</code></em>}</code> and
              <code class="literal">{<em class="replaceable"><code>m</code></em>,<em class="replaceable"><code>n</code></em>}</code>
              notation provide a more general way of writing regular
              expressions that match many occurrences of the previous
              atom (or <span class="quote">“<span class="quote">piece</span>”</span>) of the pattern.
              <em class="replaceable"><code>m</code></em> and
              <em class="replaceable"><code>n</code></em> are integers.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  <code class="literal">a*</code>
                </p><p>
                  Can be written as <code class="literal">a{0,}</code>.
                </p></li><li class="listitem"><p>
                  <code class="literal">a+</code>
                </p><p>
                  Can be written as <code class="literal">a{1,}</code>.
                </p></li><li class="listitem"><p>
                  <code class="literal">a?</code>
                </p><p>
                  Can be written as <code class="literal">a{0,1}</code>.
</p></li></ul>
</div>
<p>
              To be more precise,
              <code class="literal">a{<em class="replaceable"><code>n</code></em>}</code> matches
              exactly <em class="replaceable"><code>n</code></em> instances of
              <code class="literal">a</code>.
              <code class="literal">a{<em class="replaceable"><code>n</code></em>,}</code>
              matches <em class="replaceable"><code>n</code></em> or more instances of
              <code class="literal">a</code>.
              <code class="literal">a{<em class="replaceable"><code>m</code></em>,<em class="replaceable"><code>n</code></em>}</code>
              matches <em class="replaceable"><code>m</code></em> through
              <em class="replaceable"><code>n</code></em> instances of
              <code class="literal">a</code>, inclusive. If both
              <em class="replaceable"><code>m</code></em> and
              <em class="replaceable"><code>n</code></em> are given,
              <em class="replaceable"><code>m</code></em> must be less than or equal to
              <em class="replaceable"><code>n</code></em>.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('abcde', 'a[bcd]{2}e');              -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('abcde', 'a[bcd]{3}e');              -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('abcde', 'a[bcd]{1,10}e');           -&gt; 1</code></pre></li><li class="listitem"><p>
              <code class="literal">[a-dX]</code>, <code class="literal">[^a-dX]</code>
            </p><p>
              Matches any character that is (or is not, if
              <code class="literal">^</code> is used) either <code class="literal">a</code>,
              <code class="literal">b</code>, <code class="literal">c</code>,
              <code class="literal">d</code> or <code class="literal">X</code>. A
              <code class="literal">-</code> character between two other
              characters forms a range that matches all characters from
              the first character to the second. For example,
              <code class="literal">[0-9]</code> matches any decimal digit. To
              include a literal <code class="literal">]</code> character, it must
              immediately follow the opening bracket
              <code class="literal">[</code>. To include a literal
              <code class="literal">-</code> character, it must be written first
              or last. Any character that does not have a defined
              special meaning inside a <code class="literal">[]</code> pair
              matches only itself.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('aXbc', '[a-dXYZ]');                 -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('aXbc', '^[a-dXYZ]$');               -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('aXbc', '^[a-dXYZ]+$');              -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('aXbc', '^[^a-dXYZ]+$');             -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('gheis', '^[^a-dXYZ]+$');            -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('gheisa', '^[^a-dXYZ]+$');           -&gt; 0</code></pre></li><li class="listitem"><p>
              <code class="literal">[=character_class=]</code>
            </p><p>
              Within a bracket expression (written using
              <code class="literal">[</code> and <code class="literal">]</code>),
              <code class="literal">[=character_class=]</code> represents an
              equivalence class. It matches all characters with the same
              collation value, including itself. For example, if
              <code class="literal">o</code> and <code class="literal">(+)</code> are the
              members of an equivalence class,
              <code class="literal">[[=o=]]</code>, <code class="literal">[[=(+)=]]</code>,
              and <code class="literal">[o(+)]</code> are all synonymous. An
              equivalence class may not be used as an endpoint of a
              range.
            </p></li><li class="listitem"><p>
              <code class="literal">[:character_class:]</code>
            </p><p>
              Within a bracket expression (written using
              <code class="literal">[</code> and <code class="literal">]</code>),
              <code class="literal">[:character_class:]</code> represents a
              character class that matches all characters belonging to
              that class. The following table lists the standard class
              names. These names stand for the character classes defined
              in the <code class="literal">ctype(3)</code> manual page. A
              particular locale may provide other class names. A
              character class may not be used as an endpoint of a range.
</p>
<div class="informaltable">
<table summary="Character class names and the meaning of each class."><col width="20%"><col width="80%"><thead><tr>
                  <th scope="col">Character Class Name</th>
                  <th scope="col">Meaning</th>
                </tr></thead><tbody><tr>
                  <td scope="row"><code class="literal">alnum</code></td>
                  <td>Alphanumeric characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">alpha</code></td>
                  <td>Alphabetic characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">blank</code></td>
                  <td>Whitespace characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">cntrl</code></td>
                  <td>Control characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">digit</code></td>
                  <td>Digit characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">graph</code></td>
                  <td>Graphic characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">lower</code></td>
                  <td>Lowercase alphabetic characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">print</code></td>
                  <td>Graphic or space characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">punct</code></td>
                  <td>Punctuation characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">space</code></td>
                  <td>Space, tab, newline, and carriage return</td>
                </tr><tr>
                  <td scope="row"><code class="literal">upper</code></td>
                  <td>Uppercase alphabetic characters</td>
                </tr><tr>
                  <td scope="row"><code class="literal">xdigit</code></td>
                  <td>Hexadecimal digit characters</td>
</tr></tbody></table>
</div>
<pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('justalnums', '[[:alnum:]]+');       -&gt; 1
mysql&gt; SELECT REGEXP_LIKE('!!', '[[:alnum:]]+');               -&gt; 0</code></pre></li></ul>
</div>
<p>
          To use a literal instance of a special character in a regular
          expression, precede it by two backslash (\) characters. The
          MySQL parser interprets one of the backslashes, and the
          regular expression library interprets the other. For example,
          to match the string <code class="literal">1+2</code> that contains the
          special <code class="literal">+</code> character, only the last of the
          following regular expressions is the correct one:
        </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('1+2', '1+2');                       -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('1+2', '1\+2');                      -&gt; 0
mysql&gt; SELECT REGEXP_LIKE('1+2', '1\\+2');                     -&gt; 1</code></pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="regexp-resource-control"></a>Regular Expression Resource Control</h4>

</div>

</div>

</div>
<p>
          <a class="link" href="regexp.html#function_regexp-like"><code class="literal">REGEXP_LIKE()</code></a> and similar
          functions use resources that can be controlled by setting
          system variables:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              The match engine uses memory for its internal stack. To
              control the maximum available memory for the stack in
              bytes, set the
              <a class="link" href="server-system-variables.html#sysvar_regexp_stack_limit"><code class="literal">regexp_stack_limit</code></a> system
              variable.
            </p></li><li class="listitem"><p>
              The match engine operates in steps. To control the maximum
              number of steps performed by the engine (and thus
              indirectly the execution time), set the
              <a class="link" href="server-system-variables.html#sysvar_regexp_time_limit"><code class="literal">regexp_time_limit</code></a> system
              variable. Because this limit is expressed as number of
              steps, it affects execution time only indirectly.
              Typically, it is on the order of milliseconds.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="regexp-compatibility"></a>Regular Expression Compatibility Considerations</h4>

</div>

</div>

</div>
<p>
          Prior to MySQL 8.0.4, MySQL used the Henry Spencer regular
          expression library to support regular expression operations,
          rather than International Components for Unicode (ICU). The
          following discussion describes differences between the Spencer
          and ICU libraries that may affect applications:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              With the Spencer library, the
              <a class="link" href="regexp.html#operator_regexp"><code class="literal">REGEXP</code></a> and
              <a class="link" href="regexp.html#operator_regexp"><code class="literal">RLIKE</code></a>
              operators work in byte-wise fashion, so they are not
              multibyte safe and may produce unexpected results with
              multibyte character sets. In addition, these operators
              compare characters by their byte values and accented
              characters may not compare as equal even if a given
              collation treats them as equal.
            </p><p>
              ICU has full Unicode support and is multibyte safe. Its
              regular expression functions treat all strings as
              <code class="literal">UTF-16</code>. You should keep in mind that
              positional indexes are based on 16-bit chunks and not on
              code points. This means that, when passed to such
              functions, characters using more than one chunk may
              produce unanticipated results, such as those shown here:
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_INSTR('🍣🍣b', 'b');
+--------------------------+
| REGEXP_INSTR('??b', 'b') |
+--------------------------+
|                        5 |
+--------------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT REGEXP_INSTR('🍣🍣bxxx', 'b', 4);
+--------------------------------+
| REGEXP_INSTR('??bxxx', 'b', 4) |
+--------------------------------+
|                              5 |
+--------------------------------+
1 row in set (0.00 sec)</code></pre><p>
              Characters within the Unicode Basic Multilingual Plane,
              which includes characters used by most modern languages,
              are safe in this regard:
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_INSTR('бжb', 'b');
+----------------------------+
| REGEXP_INSTR('бжb', 'b')   |
+----------------------------+
|                          3 |
+----------------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT REGEXP_INSTR('עבb', 'b');
+----------------------------+
| REGEXP_INSTR('עבb', 'b')   |
+----------------------------+
|                          3 |
+----------------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT REGEXP_INSTR('µå周çб', '周');
+------------------------------------+
| REGEXP_INSTR('µå周çб', '周')       |
+------------------------------------+
|                                  3 |
+------------------------------------+
1 row in set (0.00 sec)</code></pre><p>
              Emoji, such as the <span class="quote">“<span class="quote">sushi</span>”</span> character
              <code class="literal">🍣</code> (U+1F363) used in the first two
              examples, are not included in the Basic Multilingual
              Plane, but rather in Unicode's Supplementary
              Multilingual Plane. Another issue can arise with emoji and
              other 4-byte characters when
              <a class="link" href="regexp.html#function_regexp-substr"><code class="literal">REGEXP_SUBSTR()</code></a> or a
              similar function begins searching in the middle of a
              character. Each of the two statements in the following
              example starts from the second 2-byte position in the
              first argument. The first statement works on a string
              consisting solely of 2-byte (BMP) characters. The second
              statement contains 4-byte characters which are incorrectly
              interpreted in the result because the first two bytes are
              stripped off and so the remainder of the character data is
              misaligned.
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_SUBSTR('周周周周', '.*', 2);
+----------------------------------------+
| REGEXP_SUBSTR('周周周周', '.*', 2)     |
+----------------------------------------+
| 周周周                                 |
+----------------------------------------+
1 row in set (0.00 sec)

mysql&gt; SELECT REGEXP_SUBSTR('🍣🍣🍣🍣', '.*', 2);
+--------------------------------+
| REGEXP_SUBSTR('????', '.*', 2) |
+--------------------------------+
| ?㳟揘㳟揘㳟揘                  |
+--------------------------------+
1 row in set (0.00 sec)</code></pre></li><li class="listitem"><p>
              For the <code class="literal">.</code> operator, the Spencer library
              matches line-terminator characters (carriage return,
              newline) anywhere in string expressions, including in the
              middle. To match line terminator characters in the middle
              of strings with ICU, specify the <code class="literal">m</code>
              match-control character.
            </p></li><li class="listitem"><p>
              The Spencer library supports word-beginning and word-end
              boundary markers (<code class="literal">[[:&lt;:]]</code> and
              <code class="literal">[[:&gt;:]]</code> notation). ICU does not. For
              ICU, you can use <code class="literal">\b</code> to match word
              boundaries; double the backslash because MySQL interprets
              it as the escape character within strings.
            </p></li><li class="listitem"><p>
              The Spencer library supports collating element bracket
              expressions (<code class="literal">[.characters.]</code> notation).
              ICU does not.
            </p></li><li class="listitem"><p>
              For repetition counts (<code class="literal">{n}</code> and
              <code class="literal">{m,n}</code> notation), the Spencer library
              has a maximum of 255. ICU has no such limit, although the
              maximum number of match engine steps can be limited by
              setting the
              <a class="link" href="server-system-variables.html#sysvar_regexp_time_limit"><code class="literal">regexp_time_limit</code></a> system
              variable.
            </p></li><li class="listitem"><p>
              ICU interprets parentheses as metacharacters. To specify a
              literal open parenthesis <code class="literal">(</code> in a regular
              expression, it must be escaped:
            </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT REGEXP_LIKE('(', '(');
ERROR 3692 (HY000): Mismatched parenthesis in regular expression.
mysql&gt; SELECT REGEXP_LIKE('(', '\\(');
+-------------------------+
| REGEXP_LIKE('(', '\\(') |
+-------------------------+
|                       1 |
+-------------------------+</code></pre></li></ul>
</div>

</div>

</div>
<br />
        </div>

                <div id="docs-in-page-nav-container">
            <div id="docs-in-page-nav">
                
    <a href="string-comparison-functions.html"
        aria-label="Previous" title="Previous: String Comparison Functions"><span
        class="icon-chevron-left"></span> PREV</a> &nbsp;
<a href="index.html" aria-label="Start" title="Start"> HOME</a> &nbsp;
        <a aria-label="Up" href="string-functions.html" title="Up: String Functions"> UP</a> &nbsp;
    <a href="string-functions-charset.html" aria-label="Next"
        title="Next: Character Set and Collation of Function Results">NEXT <span
        class="icon-chevron-right"></span></a>
            </div>
        </div>
        
         <div id="docs-body-extra">
             
<a class="docs-sidebar-section" href=""><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
        <a href="/doc/relnotes/mysql/8.0/en/">MySQL 8.0 Release Notes</a><br />
        <a href="/doc/dev/mysql-server/latest/">MySQL 8.0 Source Code Documentation</a><br />
        </div>
</div>

    <a class="docs-sidebar-section" href=""><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.pdf">PDF (US Ltr)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.a4.pdf">PDF (A4)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-pdf-1-20190611.noarch.rpm">PDF (RPM)</a>
            - 41.5Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-html-chapter-1-20190611.noarch.rpm">HTML Download (RPM)</a>
            - 9.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 220.4Kb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.zip">Man Pages (Zip)</a>
            - 325.8Kb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.gz">Info (Gzip)</a>
            - 4.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.zip">Info (Zip)</a>
            - 4.1Mb<br />
                    </div>
    </div>

<a class="docs-sidebar-section" href=""><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="/doc/mysql-backup-excerpt/8.0/en/">MySQL Backup and Recovery</a><br />
                <a href="/doc/mysql-g11n-excerpt/8.0/en/">MySQL Globalization</a><br />
                <a href="/doc/mysql-infoschema-excerpt/8.0/en/">MySQL Information Schema</a><br />
                <a href="/doc/mysql-installation-excerpt/8.0/en/">MySQL Installation Guide</a><br />
                <a href="/doc/mysql-security-excerpt/8.0/en/">Security in MySQL</a><br />
                <a href="/doc/mysql-startstop-excerpt/8.0/en/">Starting and Stopping MySQL</a><br />
                <a href="/doc/mysql-linuxunix-excerpt/8.0/en/">MySQL and Linux/Unix</a><br />
                <a href="/doc/mysql-windows-excerpt/8.0/en/">MySQL and Windows</a><br />
                <a href="/doc/mysql-osx-excerpt/8.0/en/">MySQL and OS X</a><br />
                <a href="/doc/mysql-solaris-excerpt/8.0/en/">MySQL and Solaris</a><br />
                <a href="/doc/mysql-sourcebuild-excerpt/8.0/en/">Building MySQL from Source</a><br />
                <a href="/doc/mysql-reslimits-excerpt/8.0/en/">MySQL Restrictions and Limitations</a><br />
                <a href="/doc/mysql-partitioning-excerpt/8.0/en/">MySQL Partitioning</a><br />
                <a href="/doc/mysql-secure-deployment-guide/8.0/en/">MySQL Secure Deployment Guide</a><br />
                <a href="/doc/mysql-tutorial-excerpt/8.0/en/">MySQL Tutorial</a><br />
                <a href="/doc/mysql-perfschema-excerpt/8.0/en/">MySQL Performance Schema</a><br />
                <a href="/doc/mysql-replication-excerpt/8.0/en/">MySQL Replication</a><br />
                <a href="/doc/mysql-repo-excerpt/8.0/en/">Using the MySQL Yum Repository</a><br />
            </div>
</div>
         </div>

              </div>
     </div>

</div>

<script>
$(function() {
    var doc = new $.doc({ 'mobile': $.browser.mobile, 'docId': 1, 'highlight': true });
});
</script>
    

            
        </div>
    </div>

    <footer class="collapsed">
        <div id="footer-bottom">
                                    <div id="footer-collapse">
                <a href="" id="expand-footer"
                    aria-label="Expand Footer"
                    title="Expand Footer"><span
                    class="icon-plus-square"></span></a>
            </div>
                        <div class="footer-contact">
                <div id="footer-contact-icon" style="display: none;">
                    <span class="icon-call-phone"></span>
                </div>
                <div id="footer-contact-numbers" style="display: none;">
                    <strong>Contact MySQL Sales</strong><br/>
                    USA/Canada: +1-866-221-0634 &nbsp;
                    (<a href="https://www.mysql.com/about/contact/phone/">More Countries &raquo;</a>)
                </div>
                <div id="footer-contact-copyright" style="display: inline-block;">
                    <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                    &nbsp; &copy; 2019, Oracle Corporation and/or its affiliates
                </div>
            </div>
            <div class="social-icons">
                <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook-square"></span></a>
                <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter-square"></span></a>
                <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin-square"></span></a>
                <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube-square"></span></a>
            </div>
            <br class="clear" />
        </div>
        <div id="footer-links">

            <div id="footer-nav"></div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/products/">Products</a></li>
                    <li><a href="https://www.mysql.com/cloud/">Oracle MySQL Cloud Service</a></li>
                    <li><a href="https://www.mysql.com/products/enterprise/">MySQL Enterprise Edition</a></li>
                    <li><a href="https://www.mysql.com/products/standard/">MySQL Standard Edition</a></li>
                    <li><a href="https://www.mysql.com/products/classic/">MySQL Classic Edition</a></li>
                    <li><a href="https://www.mysql.com/products/cluster/">MySQL Cluster CGE</a></li>
                    <li><a href="https://www.mysql.com/oem/">MySQL Embedded (OEM/ISV)</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/services/">Services</a></li>
                    <li><a href="https://www.mysql.com/training/">Training</a></li>
                    <li><a href="https://www.mysql.com/certification/">Certification</a></li>
                    <li><a href="https://www.mysql.com/consulting/">Consulting</a></li>
                    <li><a href="https://www.mysql.com/support/">Support</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/downloads/">Downloads</a></li>
                    <li><a href="https://dev.mysql.com/downloads/mysql/">MySQL Community Server</a></li>
                    <li><a href="https://dev.mysql.com/downloads/cluster/">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/downloads/shell/">MySQL Shell</a></li>
                    <li><a href="https://dev.mysql.com/downloads/router/">MySQL Router</a></li>
                    <li><a href="https://dev.mysql.com/downloads/workbench/">MySQL Workbench</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/doc/">Documentation</a></li>
                    <li><a href="https://dev.mysql.com/doc/refman/en/">MySQL Reference Manual</a></li>
                    <li><a href="https://dev.mysql.com/doc/workbench/en/">MySQL Workbench</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-cluster.html">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-connectors.html">MySQL Connectors</a></li>
                    <li><a href="https://dev.mysql.com/doc/#topic">Topic Guides</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/about/">About MySQL</a></li>
                    <li><a href="https://www.mysql.com/about/contact/">Contact Us</a></li>
                                                            <li><a href="https://www.mysql.com/buy-mysql/">How to Buy</a></li>
                    <li><a href="https://www.mysql.com/partners/">Partners</a></li>
                    <li><a href="https://www.mysql.com/about/jobs/">Job Opportunities</a></li>
                    <li><a href="https://www.mysql.com/sitemap.html">Site Map</a></li>
                </ul>
            </div>

            
            <div id="footer-logo">
                <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                &nbsp; &copy; 2019, Oracle Corporation and/or its affiliates
                <div class="footer-legal-links">
                    <a href="https://www.mysql.com/about/legal/">Legal Policies</a> |
                    <a href="http://www.oracle.com/us/legal/privacy/index.htm">Your Privacy Rights</a> |
                    <a href="http://www.oracle.com/us/legal/terms/index.html">Terms of Use</a> |
                    <a href="http://www.oracle.com/us/legal/third-party-trademarks/index.html">Trademark Policy</a> |
                    <a href="http://www.oracle.com/technetwork/community/oca-486395.html">Contributor Agreement</a> |
                    <div id="teconsent" style="display: inline-block"><script async="async" type="text/javascript" src="js/notice.js" crossorigin=""></script></div>
                </div>
            </div>

        </div>
    </footer>
</div>

        <script src="js/s_code_remote.js"></script>

        
    
</body>
</html>
